#pragma once

#include <iostream>
#include "Connection.hpp"
#include "Socket.hpp"
#include "TcpServer.hpp"
using namespace MySocket;

class Listener : public Connection
{
public:
    Listener(int port = defaultport):_port(port),_listensockfd(std::make_unique<TcpSocket>())
    {
        //创建套接字
        _listensockfd->BuildSocket(_port);
        SetFd(_listensockfd->Fd());
        SetEvent(EPOLLIN);
    }

    void Recver()
    {}
    void Sender()
    {}
    void Expecter()
    {}
    ~Listener()
    {}
private:
    int _port;
    std::unique_ptr<TcpSocket> _listensockfd;
};